<div class="span10" style="background: #fff;margin-left: 2px;">
<table width="100%" style="margin: 0;padding: 0;" id="_content">
    <tr>
        <td class="hzbar"></td>
        <td style="padding: 10px 15px;" valign="top">
<?php echo $this->session->flashdata('_message'); ?>
<!-- Modal Form -->
<div style="margin-bottom: 15px;"></div>

<?php
global $site_info;
$payment_method = array(1=>'Trực tuyến',2=>'Ngân hàng',3=>'Tại nhà');
$shipping_method = array(1=>'Phát nhanh',2=>'Phát thường',3=>'Tại Cty',4=>'60 phút');
$payment_status = array(1=>'Đã thanh toán',2=>'Tạm giữ',0=>'Chưa thanh toán');
$order_status = array(0=>'Chưa xử lý',1=>'Đang xử lý',2=>'Đang chuyển hàng',3=>'Hoàn tất',4=>'Hủy bỏ');
if(!empty($orders)){
?>
    <table class="table table-striped table-bordered table-condensed">
        <tr>
            <th>#</th>
            
            <th>User IP</th>
            <th>Order Date</th>
            <th>Name</th>
            <th>Staff</th>
            <th>Shipping</th>
            <th>Payment</th>
            <th>Payment Status</th>
            <th>Delivery</th>
            <th>Status</th>
            <th>Detail</th>
            <th>Cancel</th>
            
            
            
        </tr>
        <?php 
        $this->load->model('tank_auth/users','user');
        
            foreach($orders as $order):
        ?>
        <tr>
            <td><?php echo  $order->order_id ?></td>
            <td><?php echo  long2ip($order->user_ip) ?></td>
            <td><?php echo  mdate($site_info['time_format'].' '.$site_info['date_format'],$order->created_at) ?></td>
            <td><?php echo  $order->order_fullname ?></td>
            <td><?php echo  _get_fullname($order->user_id) ?></td>
            
            <td><?php echo  $shipping_method[$order->shipping_method] ?></td>
            <td><?php echo  $payment_method[$order->payment_method] ?></td>
            <td><?php echo  $payment_status[$order->payment_status] ?></td>
            <td><?php echo  $order->delivery_date ?></td>
            <td><?php echo  $order_status[$order->status] ?></td>
            <td>
            <?php echo anchor('administrator/shop/order/detail/'.$order->order_id,'Detail', 'class="btn action"') ?>
            </td>
            
            <td>
            <?php echo anchor('administrator/shop/order/cancel/'.$order->order_id,'Cancel', 'class="btn action"') ?>
            </td>
            
        </tr>
        <?php endforeach; ?>
    </table>
<?php
}else{
    echo '<div class="alert alert-info"><h4 class="alert-heading">Thông báo!</h4>Chưa có đơn hàng nào...</div>';
}
?></td></tr></table>
</div>